import { useStorage } from '@/utils/index';
import { ref } from 'vue';
export default () => {
    const storage = useStorage()
    const TabbarKey = 'TABBAR'
    const TABBAR = ref();
    const setTabbar = (Tabbar) => {
        TABBAR.value = Tabbar;
        return storage.set(TabbarKey, Tabbar);
    }
    const initTabbar = () => {
        const tabbar = storage.get(TabbarKey)
        if (tabbar !== null) {
            setTabbar(tabbar);
        }
    }
    const clearTabbar = () => {
        TABBAR.value = undefined;
        return storage.remove(TabbarKey)
    }
    return {
        TABBAR,
        setTabbar,
        initTabbar,
        clearTabbar,
    };
}